package com.chixing.controller;

import com.chixing.util.ServerResponse;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

@RestController
public class FileController {
    //身份证
    @PostMapping("uploadSingleFileAjax/person")
    public ServerResponse uploadPersonFileAjax(@RequestParam("myimage") MultipartFile multipartFile, HttpServletRequest request) throws Exception {
        ServerResponse serverResponse = AppCodeId.personCard(multipartFile);
        return serverResponse;
    }

    //驾驶证
    @PostMapping("uploadSingleFileAjax/car")
    public ServerResponse uploadCarSingleFileAjax(@RequestParam("carimage") MultipartFile multipartFile,HttpServletRequest request) throws Exception {
        ServerResponse serverResponse = AppCodeDriver.driverCard(multipartFile);
        return serverResponse;
    }
}
